// arguments are immutable by default, even when references are passed
// mutable args have to be marked on call
fn main() {
	mut user := User{}
	println(user.is_registered)
	user.register()
	println(user.is_registered)	
	
	mut nums := [1, 2, 3]
	multiply_by_2(mut nums) // marked on call as mutable
	println(nums)
}

struct User {
	name string
mut:
	is_registered bool
}

// the receiver is just the first argument
fn (mut u User) register() {
	u.is_registered = true
}

// 
fn multiply_by_2(mut arr []int) {
	for i in 0 .. arr.len {
		arr[i] *= 2
	}
}
